<template>
  <div class="button-box">
    <a-button type="default"
              @click="handleBack">
      <LeftOutlined />
      返回上一页
    </a-button>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { useRouter } from 'vue-router';
import { LeftOutlined } from '@ant-design/icons-vue';

export default defineComponent({
  components: {
    LeftOutlined,
  },

  emits: ['back'],

  setup() {
    const router = useRouter();
    const handleBack = () => {
      router.go(-1);
    };

    return {
      handleBack,
    };
  },
});
</script>

<style lang="less" scoped>
.button-box {
  .flex-type(flex-start);

  .ant-btn {
    border-color: rgba(32, 79, 199, 1);
    color: rgba(32, 79, 199, 1);
  }
}
</style>
